/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package photoshare.services;

import java.sql.SQLException;
import java.util.ArrayList;
import photoshare.dao.PhotoDAO;
import photoshare.dto.PhotoDTO;

/**
 *
 * @author PhotoShare
 */
public class PhotoService {

    public PhotoService() {
    }

    public boolean create(PhotoDTO photoDTO) throws SQLException {
        return new PhotoDAO().create(photoDTO);
    }

    public ArrayList<PhotoDTO> findAll() {
        return new PhotoDAO().readAll();
    }

    public PhotoDTO readById(Integer photoId) {
        return new PhotoDAO().readById(photoId);
    }

    public boolean updateById(PhotoDTO photoDTO, Integer photoId) throws SQLException {
        return new PhotoDAO().updateById(photoDTO, photoId);
    }

    public boolean deleteById(Integer photoId) throws SQLException {

        return new PhotoDAO().deleteById(photoId);
    }

}
